//获取元素距离页面顶部的距离
export default function (element) {
  var realTop = element.offsetTop
  var parent = element.offsetParent
  while (parent !== null) {
    realTop += parent.offsetTop
    parent = parent.offsetParent
  }
  return realTop
}
